<!DOCTYPE html>
<html>
<head>
    <?php date_default_timezone_set('Asia/Shanghai'); ?>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>美乐乐 | 后台登录</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="{{ asset('/admin/bootstrap/css/bootstrap.min.css') }}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="{{ asset('/admin/bootstrap/css/font-awesome.min.css') }}">
    <!-- Ionicons -->
    <link rel="stylesheet" href="{{ asset('/admin/bootstrap/css/ionicons.min.css') }}">
    <!-- Theme style -->
    <link rel="stylesheet" href="{{ asset('/admin/dist/css/AdminLTE.min.css') }}">
    <!-- iCheck -->
    <link rel="stylesheet" href="{{ asset('/admin/plugins/iCheck/square/blue.css') }}">


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition login-page" style="background-image:url('{{ asset("/uploads/login/blur-background.jpg") }}');background-repeat:no-repeat;background-size:100% 100%;">
<div class="login-box">


    @if(count($errors) > 0)
        <div class="alert alert-danger alert-dismissable">
        <button aria-hidden="true" data-dismiss="alert" class="close" type="button">x</button>
            <h4><i class="icon fa fa-ban"></i>警告!</h4>
                <ol>
                    @foreach ($errors -> all() as $error)
                        <li>{{$error}}</li>
                    @endforeach
                </ol>
        </div>
    @endif

    @if(session('info'))
        <div id="showHidden" class="alert alert-success alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        <h4>    <i class="icon fa fa-check"></i> 提示!</h4>
        {{ session('info') }}
      </div>
    @endif

    @if(session('error'))
        <div id="showHidden" class="alert alert-danger alert-dismissable">
        <button aria-hidden="true" data-dismiss="alert" class="close" type="button">x</button>
            <h4><i class="icon fa fa-ban"></i>警告!</h4>
               {{ session('error') }} 
        </div>
   @endif

   <div class="login-box">
      <div class="login-logo">
        <a href="#"><b>美楽楽后台管理系统</b></a>
      </div>
      <div class="login-box-body">
      <script type="text/javascript">

            window.onload=function(){
             //定时器每秒调用一次fnDate()
             setInterval(function(){
             fnDate();
             },1000);
             }
             //js 获取当前时间
            function fnDate(){
             var oDiv=document.getElementById("time");
             var date=new Date();
             var year=date.getFullYear();//当前年份
            var month=date.getMonth();//当前月份
            var data=date.getDate();//天
            var hours=date.getHours();//小时
            var minute=date.getMinutes();//分
            var second=date.getSeconds();//秒
            var time="当前时间："+year+"年"+fnW((month+1))+"月"+fnW(data)+"日"+fnW(hours)+"时"+fnW(minute)+"分"+fnW(second)+"秒";
             oDiv.innerHTML=time;
             }
             //补位 当某个字段不是两位数时补0
             function fnW(str){
             var num;
             str>=10?num=str:num="0"+str;
             return num;
             } 

          
      </script>
      <form action="{{ url('/admin/dologin') }}" method="post">
      {{  csrf_field() }}
      <input type="hidden" name="last_ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
        <p class="login-box-msg" id="time"></p>
          <div class="form-group has-feedback">
            <input type="text" placeholder="账号" class="form-control" id="username" name="account">
            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
            <input type="password" placeholder="密码" id="password" class="form-control" name="password">
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
            <opinioncontrol default="true" opinion_name="vertify_code" realtime="true">
                <div style="padding-right: 65px;" class="row">
                    <div class="col-xs-9">
                        <input type="text" placeholder="验证码" class="form-control" name="code" style="width: 200px">
                    </div>
                    <div class="col-md-3">
                      <a id="code" onclick="javascript:re_captcha();" ><img src="{{ URL('kit/captcha/1') }}"  alt="验证码" title="刷新图片" width="85" height="35" id="c2c98f0de5a04167a9e427d883690ff6" border="0"></a>

                    <script>  
                      function re_captcha() {
                        $url = "{{ URL('kit/captcha') }}";
                            $url = $url + "/" + Math.random();
                            document.getElementById('c2c98f0de5a04167a9e427d883690ff6').src=$url;
                      }

                    </script>
                </div>
                </div>
            </opinioncontrol>
          </div>
          <!-- 
          <div class="row">
            <div class="col-xs-8">
              <div class="checkbox icheck">
                <label><input type="checkbox"> 记住密码  </label>
              </div>
            </div>
            <div class="col-xs-4">
              <div class="checkbox icheck">
                <label><a href="#">找回密码</a></label>
              </div>
            </div>
          </div> --> 
          <div class="form-group">
             <button type="submit" class="btn btn-primary btn-block btn-flat">立即登陆 </button>  
          </div>
      </div>

      </form>
        <div class="margin text-center">
            <div class="copyright">
                2014-2016 &copy; <a>MLL 1.0.0</a> <a>愤怒的小鸟</a> 出品
            </div>
        </div>
    </div>

    
</div><!-- /.login-box -->

<!-- jQuery 2.1.4 -->
<script src="{{ asset('/admin/plugins/jQuery/jQuery-2.1.4.min.js') }}"></script>
<!-- Bootstrap 3.3.5 -->
<script src="{{ asset('/admin/bootstrap/js/bootstrap.min.js') }}"></script>
<!-- iCheck -->
<script src="{{ asset('/admin/plugins/iCheck/icheck.min.js') }}"></script>
<script>
    $(function () {
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' // optional
        });
    });
</script>
</body>
</html>
